import {
  createStore
} from 'vuex'
import axios from 'axios'
import persist from 'vuex-persistedstate'
export default createStore({
  state: {
    objList: [],
    valuePshu: ''
  },
  mutations: {
    history(state, val) {
      let flag = state.objList.findIndex(item => item == val)
      if (flag != -1) {
        state.objList.splice(flag, 1)
      }
      state.objList.unshift(val)

    },

    remove(state, val) {
      state.objList.splice(val, 1)
    },

    removeAll(state) {
      state.objList = []
    },

    pushValues(state, val) {
      state.valuePshu = val
    }
  },


  actions: {


  },
  plugins: [persist()]


})